import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from "@/views/Index";
import User from "@/components/User";
import Dept from "@/components/Dept";
import Position from "@/components/Position";
import Login from "@/views/Login";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/Index',
    name: 'Index',
    component: Index,
    children: [
      {
        path: '/User',
        name: 'User',
        component: User
      },
      {
        path: '/Dept',
        name: 'Dept',
        component: Dept
      },
      {
        path: '/Position',
        name: 'Position',
        component: Position
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
